import request from "@/plugin/axios";

const BASE_URL = "sys/menu";

export function MenuList({ parentId, params }) {
  return request({
    url: BASE_URL + "/" + parentId + "/tree",
    method: "get",
    params,
  });
}

export function MenuAdd(data) {
  return request({
    url: BASE_URL,
    method: "post",
    data,
  });
}

export function MenuUpdate(data) {
  return request({
    url: BASE_URL + "/" + data.id,
    method: "put",
    data,
  });
}

export function MenuDel(id) {
  return request({
    url: BASE_URL + "/" + id,
    method: "delete",
  });
}

export function MenuBatch(data) {
  return request({
    url: BASE_URL + "/batch",
    method: "put",
    data,
  });
}

export function MenuDetail(id) {
  return request({
    url: BASE_URL + "/" + id,
    method: "get",
  });
}

export function MenuAppTree() {
  return request({
    url: BASE_URL + "/tree",
    method: "get",
  });
}

export function MenuAppSimpleTree() {
  return request({
    url: BASE_URL + "/simple",
    method: "get",
  });
}
